﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Froggy;
using Froggy.Data;

namespace eMMBox.DA
{
    public class Login_DA
    {
        public static bool UserExists(string user, string pass)
        {
            string sql = @"EXEC SP_UserExists @login, @password";
            DbCommandUtil db = new DbCommandUtil(sql);
            db.AddParameter("@login", DbType.String, user);
            db.AddParameter("@password", DbType.String, pass);
            //if user exists
            if (db.ExecuteScalar<int>() == 1)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}
